<template>
  <!-- 门诊工作统计 -->
  <div>
    <h1>门 诊 工 作 统 计 报 表</h1>
    <h2>医院名称:湖北省中医院</h2>
    <el-table :data="tableData" stripe border style="width: 100%">
      <el-table-column prop="lmmc" label="项目" align="center" width="170"></el-table-column>
      <el-table-column prop="y0101" label="一月份" align="center" width></el-table-column>
      <el-table-column prop="y0202" label="二月份" align="center" width></el-table-column>
      <el-table-column prop="y0303" label="三月份" align="center" width></el-table-column>
      <el-table-column prop="y0103" label="一季度" align="center" width></el-table-column>
      <el-table-column prop="y0404" label="四月份" align="center" width></el-table-column>
      <el-table-column prop="y0505" label="五月份" align="center" width></el-table-column>
      <el-table-column prop="y0606" label="六月份" align="center" width></el-table-column>
      <el-table-column prop="y0406" label="二季度" align="center" width></el-table-column>
      <el-table-column prop="y0106" label="上半年" align="center" width></el-table-column>
      <el-table-column prop="y0707" label="七月份" align="center" width></el-table-column>
      <el-table-column prop="y0808" label="八月份" align="center" width></el-table-column>
      <el-table-column prop="y0909" label="九月份" align="center" width></el-table-column>
      <el-table-column prop="y0709" label="三季度" align="center" width></el-table-column>
      <el-table-column prop="y1010" label="十月份" align="center" width></el-table-column>
      <el-table-column prop="y1111" label="十一月份" align="center" width></el-table-column>
      <el-table-column prop="y1212" label="十二月份" align="center" width></el-table-column>
      <el-table-column prop="y1012" label="四季度" align="center" width></el-table-column>
      <el-table-column prop="y0712" label="下半年" align="center" width></el-table-column>
      <el-table-column prop="y0112" label="全年" align="center" width></el-table-column>
    </el-table>
  </div>
</template>

<script>
import { deptWorkLedger } from "@/api";
import { showOkMsg, showErrorMsg } from "@/utils/index.js";

export default {
  data() {
    return {
      tableData: [],
      startDate: ""
    };
  },
  created() {
    this.getTableList();
  },
  props: ["dateList"],
  methods: {
    getTableList() {
      if (this.dateList.dateBegin && this.dateList.dateEnd) {
        deptWorkLedger({
          kb: this.dateList.administrative,
          startTime: this.dateList.dateBegin
        }).then(res => {
          if (res.code === 0) {
            this.startDate = this.dateList.dateBegin;
            this.endDate = this.dateList.dateEnd;
            this.tableData = res.data;
            showOkMsg(res.msg);
          }
        });
      } else {
        showErrorMsg("请选择开始和结束日期");
      }
    }
  }
};
</script>

<style scoped>
h1 {
  font-size: 24px;
  text-align: center;
  padding: 23px 0;
}
h3 {
  text-align: center;
  padding-bottom: 20px;
}
h2 {
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
}
</style>